import 'package:taonile/generated/json/base/json_field.dart';
import 'package:taonile/generated/json/query_express_info_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class QueryExpressInfoEntity {
  late int code = 0;
  late String msg;
  late QueryExpressInfoData data = QueryExpressInfoData();

  QueryExpressInfoEntity();

  factory QueryExpressInfoEntity.fromJson(Map<String, dynamic> json) =>
      $QueryExpressInfoEntityFromJson(json);

  Map<String, dynamic> toJson() => $QueryExpressInfoEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class QueryExpressInfoData {
  late String message;
  late String nu;
  late String ischeck;
  late String com;
  late String status;
  late List<QueryExpressInfoDataData> data = [];
  late String state;
  late String condition;
  late QueryExpressInfoDataRouteInfo routeInfo;
  late bool isLoop;
  late String trailUrl;
  late String arrivalTime;
  late String totalTime;
  late String remainTime;

  QueryExpressInfoData();

  factory QueryExpressInfoData.fromJson(Map<String, dynamic> json) =>
      $QueryExpressInfoDataFromJson(json);

  Map<String, dynamic> toJson() => $QueryExpressInfoDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class QueryExpressInfoDataData {
  late String time;
  late String context;
  late String ftime;
  late String areaCode;
  late String areaName;
  late String status;
  late String location;
  late String areaCenter;
  late String areaPinYin;
  late String statusCode;

  QueryExpressInfoDataData();

  factory QueryExpressInfoDataData.fromJson(Map<String, dynamic> json) =>
      $QueryExpressInfoDataDataFromJson(json);

  Map<String, dynamic> toJson() => $QueryExpressInfoDataDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class QueryExpressInfoDataRouteInfo {
  late QueryExpressInfoDataRouteInfoFrom from;
  late QueryExpressInfoDataRouteInfoCur cur;
  late QueryExpressInfoDataRouteInfoTo to;

  QueryExpressInfoDataRouteInfo();

  factory QueryExpressInfoDataRouteInfo.fromJson(Map<String, dynamic> json) =>
      $QueryExpressInfoDataRouteInfoFromJson(json);

  Map<String, dynamic> toJson() => $QueryExpressInfoDataRouteInfoToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class QueryExpressInfoDataRouteInfoFrom {
  late String number;
  late String name;

  QueryExpressInfoDataRouteInfoFrom();

  factory QueryExpressInfoDataRouteInfoFrom.fromJson(Map<String, dynamic> json) =>
      $QueryExpressInfoDataRouteInfoFromFromJson(json);

  Map<String, dynamic> toJson() => $QueryExpressInfoDataRouteInfoFromToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class QueryExpressInfoDataRouteInfoCur {
  late String number;
  late String name;

  QueryExpressInfoDataRouteInfoCur();

  factory QueryExpressInfoDataRouteInfoCur.fromJson(Map<String, dynamic> json) =>
      $QueryExpressInfoDataRouteInfoCurFromJson(json);

  Map<String, dynamic> toJson() => $QueryExpressInfoDataRouteInfoCurToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class QueryExpressInfoDataRouteInfoTo {
  late String number;
  late String name;

  QueryExpressInfoDataRouteInfoTo();

  factory QueryExpressInfoDataRouteInfoTo.fromJson(Map<String, dynamic> json) =>
      $QueryExpressInfoDataRouteInfoToFromJson(json);

  Map<String, dynamic> toJson() => $QueryExpressInfoDataRouteInfoToToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
